package user_service

import (
	"go_service/database/mysql"
	user_model "go_service/model/user"
)

// 创建用户
func CreateUser(user user_model.User) bool {
	return true
}

// 用户登录
func UserLogin(username string, password string) bool {
	userList := []user_model.User{}
	mysql.MDB.Raw("select * tb_user where username = ?", username).Scan(&userList)
	if len(userList) == 0 {
		return false
	}
	hashPassword := userList[0].Password
	return hashPassword == password
}
